
import { request } from "@umijs/max";
export const addApi = (data: any) => {
  return request('/tableInfo/add', {
    method: 'POST',
    data: data,
  });
}

export const selectListApi = (data: any) => {
  return request('/tableInfo/selectList', {
    method: 'POST',
    data: data,
  });
}

export const deleteApi = (id: number) => {
  return request('/tableInfo/delete', {
    method: 'POST',
    data: {
      ids:[id]
    },
  });
}
export const updateApi = (data: any) => {
  return request('/tableInfo/update', {
    method: 'POST',
    data: data,
  });
}


export const selectOneApi = (data: any) => {
  return request('/tableInfo/selectOne', {
    method: 'POST',
    data: data,
  });
}
    
export const addFieldBatchApi = (data: any) => {
  return request('/fieldInfo/addBatch', {
    method: 'POST',
    data: data,
  });
}
    

export const selectByParentIdApi = (parentId:number) => {
  return request('/fieldInfo/selectByParentId', {
    method: 'POST',
    data: {parentId},
  });
}
    
    
export const createCodeApi = (data: any) => {
  return request('/tableInfo/createCode', {
    method: 'POST',
    data: data,
  });
}
    